package zuk.clipvuiviet.clipadapter;



import java.util.ArrayList;
import java.util.List;

import zuk.clipvuiviet.getdata.SetList;

import android.content.Context;
import android.os.AsyncTask;

public class LoadClipEnlessAdapterTask extends AsyncTask <Void,Void,List<Clip>>{
	private Context mContext;
    private  ClipAdapter mAdapter;
    private int i_page;
    String tab;
    public LoadClipEnlessAdapterTask(int i,Context context,String tab,ClipAdapter mAdapter){
    	i_page = i;
    	mContext = context;
    	this.mAdapter = mAdapter;
    	this.tab = tab;
    	
    }
   
	@Override
	protected List<Clip> doInBackground(Void... params) {
		// TODO Auto-generated method stub
		List<Clip> list_page = new ArrayList<Clip>();
		list_page = new SetList().setlist(tab, Integer.toString(i_page));
		return list_page;
	}
	@Override
	protected void onPostExecute(List<Clip> result) {
		// TODO Auto-generated method stub
		super.onPostExecute(result);
		for (Clip clip : result) {
			mAdapter.add(clip);
			mAdapter.notifyDataSetChanged();
		}
		
	}
	
	

}
